<?php
namespace ok;

class Controller{

	//模板赋值
	public function assign($name,$value){
		$this->$name = $value;
	}

	//模板渲染
	public function fetch($file){
		$modular = modular();
		$files = APP_PATH . $modular . '/view/' . $file . '.html';
		//模版 不存在
		if(!is_file($files)){
			echo '<br><b>Fatal error</b> :file <b>app/'. $modular .'/view/' . $file . ' .html </b>Not  found';
			return ;
		}
		foreach($this as $k=>$v){
			$$k = $v;
		}
		require($files);
	}
}